package oj0329.oj0329_04;


import java.util.Scanner;

public class Main {
    public static void dToB(int x){
        if (x == 0 || x == 1){
            System.out.print(x);
            return;
        }
//        System.out.println(x);
        dToB(x / 2);
//        System.out.println(x);
        System.out.print(x % 2);
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();   //案例数量
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            dToB(x);
            System.out.println();
        }
        sc.close();
    }
}
